package com.ctsi.unZip;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.zip.GZIPInputStream;

public class UnGzFile {
	public static void main(String[] args){ 
		Properties props = new Properties();
		try {
			InputStream in = new BufferedInputStream(new FileInputStream(args[0]));
			props.load(in);
			String inputPath=String.valueOf(props.getProperty("inputpath"));
			String outputPath=String.valueOf(props.getProperty("outputpath"));
			String interval=String.valueOf(props.getProperty("interval"));
			System.out.println(inputPath+ "	"+outputPath+"	"+interval);
			FileMonitor m = new FileMonitor(Integer.parseInt(interval));  
			m.monitor(inputPath,new FileListener(outputPath));  
			m.start();  
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
